package com.gzhryc.pay.adaptation.weixin.msg.normal;

import com.gzhryc.pay.adaptation.weixin.msg.GoodsDetailItem;
import com.gzhryc.pay.adaptation.weixin.msg.WXPayAPIResponse;

import java.io.Serializable;
import java.util.List;

public class WXPayNormalRefundResponse extends WXPayAPIResponse {

    private String refund_id;       //微信支付退款单号
    private String out_refund_no;   //商户退款单号
    private String transaction_id;  //微信支付订单号
    private String out_trade_no;    //商户订单号
    /**
     * 枚举值：
     * ORIGINAL：原路退款
     * BALANCE：退回到余额
     * OTHER_BALANCE：原账户异常退到其他余额账户
     * OTHER_BANKCARD：原银行卡异常退到其他银行卡
     */
    private String channel;         //退款渠道
    private String user_received_account;   //退款入账账户,退回银行卡：{银行名称}{卡类型}{卡尾号}
    private String success_time;        //退款成功时间,如：2020-12-01T16:18:12+08:00
    private String create_time;         //退款创建时间
    /**
     * 枚举值：
     * SUCCESS：退款成功
     * CLOSED：退款关闭
     * PROCESSING：退款处理中
     * ABNORMAL：退款异常
     */
    private String status;              //退款状态
    /**
     * 枚举值：
     * UNSETTLED : 未结算资金
     * AVAILABLE : 可用余额
     * UNAVAILABLE : 不可用余额
     * OPERATION : 运营户
     * BASIC : 基本账户（含可用余额和不可用余额）
     */
    private String funds_account;       //资金账户,退款所使用资金对应的资金账户类型
    private AmountItem amount;          //金额详细信息
    private List<PromotionDetailItem> promotion_detail;
    private List<GoodsDetailItem>  goods_detail;

    public String getRefund_id() {
        return refund_id;
    }

    public void setRefund_id(String refund_id) {
        this.refund_id = refund_id;
    }

    public String getOut_refund_no() {
        return out_refund_no;
    }

    public void setOut_refund_no(String out_refund_no) {
        this.out_refund_no = out_refund_no;
    }

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getUser_received_account() {
        return user_received_account;
    }

    public void setUser_received_account(String user_received_account) {
        this.user_received_account = user_received_account;
    }

    public String getSuccess_time() {
        return success_time;
    }

    public void setSuccess_time(String success_time) {
        this.success_time = success_time;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getFunds_account() {
        return funds_account;
    }

    public void setFunds_account(String funds_account) {
        this.funds_account = funds_account;
    }

    public AmountItem getAmount() {
        return amount;
    }

    public void setAmount(AmountItem amount) {
        this.amount = amount;
    }

    public List<PromotionDetailItem> getPromotion_detail() {
        return promotion_detail;
    }

    public void setPromotion_detail(List<PromotionDetailItem> promotion_detail) {
        this.promotion_detail = promotion_detail;
    }

    public List<GoodsDetailItem> getGoods_detail() {
        return goods_detail;
    }

    public void setGoods_detail(List<GoodsDetailItem> goods_detail) {
        this.goods_detail = goods_detail;
    }

    public static class AmountItem implements Serializable {

        private static final long serialVersionUID = 1L;

        private Integer total;      //订单金额
        private Integer refund;     //退款金额
        private Integer payer_total;    //用户支付金额
        private Integer payer_refund;   //用户退款金额
        private Integer settlement_refund;     //应结退款金额,去掉非充值代金券退款金额后的退款金额,退款金额=申请退款金额-非充值代金券退款金额，退款金额<=申请退款金额
        private Integer settlement_total;       //应结订单金额,应结订单金额=订单金额-免充值代金券金额，应结订单金额<=订单金额，单位为分
        private Integer discount_refund;        //优惠退款金额,优惠退款金额<=退款金额，退款金额-代金券或立减优惠退款金额为现金
        private String currency;        //退款币种,只支持人民币：CNY。
        private List<AmountFromItem> from;  //退款出资账户及金额

        public Integer getTotal() {
            return total;
        }

        public void setTotal(Integer total) {
            this.total = total;
        }

        public Integer getRefund() {
            return refund;
        }

        public void setRefund(Integer refund) {
            this.refund = refund;
        }

        public Integer getPayer_total() {
            return payer_total;
        }

        public void setPayer_total(Integer payer_total) {
            this.payer_total = payer_total;
        }

        public Integer getPayer_refund() {
            return payer_refund;
        }

        public void setPayer_refund(Integer payer_refund) {
            this.payer_refund = payer_refund;
        }

        public Integer getSettlement_refund() {
            return settlement_refund;
        }

        public void setSettlement_refund(Integer settlement_refund) {
            this.settlement_refund = settlement_refund;
        }

        public Integer getSettlement_total() {
            return settlement_total;
        }

        public void setSettlement_total(Integer settlement_total) {
            this.settlement_total = settlement_total;
        }

        public Integer getDiscount_refund() {
            return discount_refund;
        }

        public void setDiscount_refund(Integer discount_refund) {
            this.discount_refund = discount_refund;
        }

        public String getCurrency() {
            return currency;
        }

        public void setCurrency(String currency) {
            this.currency = currency;
        }

        public List<AmountFromItem> getFrom() {
            return from;
        }

        public void setFrom(List<AmountFromItem> from) {
            this.from = from;
        }
    }

    public static class AmountFromItem implements Serializable {

        private static final long serialVersionUID = 1L;

        private String account;     //出资账户类型,枚举值：AVAILABLE : 可用余额，UNAVAILABLE : 不可用余额
        private Integer amount;      //出资金额

        public String getAccount() {
            return account;
        }

        public void setAccount(String account) {
            this.account = account;
        }

        public Integer getAmount() {
            return amount;
        }

        public void setAmount(Integer amount) {
            this.amount = amount;
        }
    }

    public static class PromotionDetailItem {

        private String promotion_id;        //券ID
        /**
         * 枚举值：
         * GLOBAL：全场代金券
         * SINGLE：单品优惠
         */
        private String scope;           //优惠范围
        /**
         * 枚举值：
         * COUPON：代金券，需要走结算资金的充值型代金券
         * DISCOUNT：优惠券，不走结算资金的免充值型优惠券
         */
        private String type;        //优惠类型
        private Integer amount;     //用户享受优惠的金额（优惠券面额=微信出资金额+商家出资金额+其他出资方金额 ）
        private Integer refund_amount;  //优惠退款金额,优惠退款金额<=退款金额，退款金额-代金券或立减优惠退款金额为用户支付的现金

        public String getPromotion_id() {
            return promotion_id;
        }

        public void setPromotion_id(String promotion_id) {
            this.promotion_id = promotion_id;
        }

        public String getScope() {
            return scope;
        }

        public void setScope(String scope) {
            this.scope = scope;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public Integer getAmount() {
            return amount;
        }

        public void setAmount(Integer amount) {
            this.amount = amount;
        }

        public Integer getRefund_amount() {
            return refund_amount;
        }

        public void setRefund_amount(Integer refund_amount) {
            this.refund_amount = refund_amount;
        }
    }
}
